﻿using System;
using System.ComponentModel.DataAnnotations;

namespace PublisherManagementSystem.Models
{
	public class PublisherStaff
	{
		[Key]
		public int StaffID { get; set; }

		public int PublisherID { get; set; }

		[Required(ErrorMessage = "姓名不能为空")]
		[Display(Name = "姓名")]
		[StringLength(50, ErrorMessage = "姓名不能超过50个字符")]
		public string Name { get; set; }

		[Required(ErrorMessage = "性别不能为空")]
		[Display(Name = "性别")]
		[StringLength(10, ErrorMessage = "性别不能超过10个字符")]
		public string Gender { get; set; }

		[Required(ErrorMessage = "出生日期不能为空")]
		[Display(Name = "出生日期")]
		[DataType(DataType.Date)]
		public DateTime BirthDate { get; set; }

		[Required(ErrorMessage = "联系电话不能为空")]
		[Display(Name = "联系电话")]
		[Phone(ErrorMessage = "请输入有效的电话号码")]
		[StringLength(20, ErrorMessage = "联系电话不能超过20个字符")]
		public string Phone { get; set; }

		[EmailAddress(ErrorMessage = "请输入有效的电子邮箱")]
		[Display(Name = "电子邮箱")]
		[StringLength(100, ErrorMessage = "电子邮箱不能超过100个字符")]
		public string Email { get; set; }

		[Display(Name = "职位")]
		[StringLength(50, ErrorMessage = "职位不能超过50个字符")]
		public string Position { get; set; }

		[Required(ErrorMessage = "入职日期不能为空")]
		[Display(Name = "入职日期")]
		[DataType(DataType.Date)]
		public DateTime JoinDate { get; set; }

		// 导航属性
		public virtual Publisher Publisher { get; set; }
	}
}
